package com.ss.android.dex.party.a;

import com.bytedance.article.b.h;

import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.util.Enumeration;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;

public class a implements h {
    public a() {

    }

    public final void a(File arg8, File arg9) throws Exception {
        File v3;
        Object v0;
        ZipFile v1 = new ZipFile(arg8);
        Enumeration v2 = v1.entries();
        while (true) {
            label_3:
            if (!v2.hasMoreElements()) {
                return;
            }

            v0 = v2.nextElement();
            v3 = new File(arg9, ((ZipEntry) v0).getName());
            if ((((ZipEntry) v0).isDirectory()) && !v3.exists()) {
                v3.mkdirs();
                continue;
            }

            if (!v3.getParentFile().exists()) {
                v3.getParentFile().mkdirs();
            }
            InputStream v0_1 = v1.getInputStream(((ZipEntry) v0));
            BufferedOutputStream v4 = new BufferedOutputStream(new FileOutputStream(v3));
            byte[] v3_1 = new byte[8192];
            while (true) {
//                label_27:
                int v6 = v0_1.read(v3_1);
                if (-1 == v6) {
                    break;
                }
                v4.write(v3_1, 0, v6);
            }

            v0_1.close();
            v4.close();
            continue;
        }
    }
}

